package com.hex.ds.hdtp.core.app.script.test.converter;

import com.hex.ds.hdtp.core.app.script.test.dto.request.ScriptDataTestListRequestDto;
import com.hex.ds.hdtp.core.app.script.test.dto.request.ScriptTestDataAnalysisRequestDto;
import com.hex.ds.hdtp.core.app.script.test.dto.response.ScriptDataTestListResponseDto;
import com.hex.ds.hdtp.core.inf.script.test.po.ScriptDataTestListPo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * @Package: com.hex.ds.hdtp.core.app.script.test.converter
 * @ClassName IScriptDataTestListConverter
 * @Description: 带数据测试清单-DTO对象转PO对象转换器
 * @Author: wz.li
 * @Date 2023/8/1 15:47
 * @Version v2.0.2
 **/
@Mapper(componentModel = "spring")
public interface IScriptDataTestListConverter {

    ScriptDataTestListPo toScriptDataTestListPo(ScriptDataTestListRequestDto scriptDataTestListRequestDto);

    ScriptDataTestListResponseDto toScriptDataTestListResponseDto(ScriptDataTestListPo scriptDataTestListPo);

    List<ScriptDataTestListResponseDto> toScriptDataTestListResponseDtoList(List<ScriptDataTestListPo> scriptDataTestListPos);

    @Mapping(target = "pkId", ignore = true)
    @Mapping(target = "testScriptTaskPkId", source = "testScriptTaskPkId")
    @Mapping(target = "testScriptListPkId", source = "scriptTestListPkId")
    @Mapping(target = "scriptName", source = "scriptName")
    @Mapping(target = "targetTableName", source = "transferTableNames")
    @Mapping(target = "tableType", source = "tableType")
    @Mapping(target = "bizDate", source = "bizDate")
    ScriptTestDataAnalysisRequestDto toScriptTestDataAnalysisRequestDto(String testScriptTaskPkId,
                                                                        String scriptTestListPkId,
                                                                        String scriptName,
                                                                        String transferTableNames,
                                                                        String tableType,
                                                                        String bizDate);
}
